package org.linlinjava.litemall.admin.web;

import com.github.pagehelper.PageInfo;
import org.linlinjava.litemall.admin.annotation.LoginAdmin;
import org.linlinjava.litemall.admin.service.AdminGroupUserService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallGroupBuy;
import org.linlinjava.litemall.db.domain.LitemallGroupBuyUser;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zhy
 * @date 2019-07-15 20:40
 **/
@RestController
@RequestMapping("/admin/groupUser")
public class AdminGroupBuyUserController {

	@Resource
	private AdminGroupUserService adminGroupUserService;

	@GetMapping("/getList")
	public Object getList(
		@LoginAdmin Integer userId,
		String remark,
		Integer groupId){
		if (userId == null) {
			return ResponseUtil.unlogin();
		}
		List<LitemallGroupBuyUser> litemallGroupBuys = adminGroupUserService.getList(remark,groupId);
		return ResponseUtil.ok(litemallGroupBuys);
	}

}
